import request from '@/utils/request'

// 查询记录项目立项的相关信息列表
export function listInitiation(query) {
  return request({
    url: '/system/initiation/list',
    method: 'get',
    params: query
  })
}

// 查询记录项目立项的相关信息详细
export function getInitiation(id) {
  return request({
    url: '/system/initiation/' + id,
    method: 'get'
  })
}

// 新增记录项目立项的相关信息
export function addInitiation(data) {
  return request({
    url: '/system/initiation',
    method: 'post',
    data: data
  })
}

// 修改记录项目立项的相关信息
export function updateInitiation(data) {
  return request({
    url: '/system/initiation',
    method: 'put',
    data: data
  })
}

// 删除记录项目立项的相关信息
export function delInitiation(id) {
  return request({
    url: '/system/initiation/' + id,
    method: 'delete'
  })
}

// 查询用户支付账户
export function getFiller(filler) {
  return request({
    url: `/system/accounts/filler?filler=${filler}`,
    method: 'get',
  })
}

// 查询增项列表
export function getChargeList(data) {
  return request({
    url: `/system/initiation/charge`,
    method: 'get',
    params: data
  })
}

// 负责人审批通过
export function updateFinancialApproval(id,managementApproval) {
  return request({
    url: `/system/initiation/financialApproval?id=${id}&managementApproval=${managementApproval}`,
    method: 'get',
  })
}

// 立项完成
export function updateProject(id,ok) {
  return request({
    url: `/system/initiation/financialApproval?id=${id}&ok=${ok}`,
    method: 'get',
  })
}

// 增项审批
export function updateAddendum(id,ok) {
  return request({
    url: `/system/initiation/addendum?id=${id}&ok=${ok}`,
    method: 'get',
  })
}

// 发票审核
export function updateInvoiceVetting(id,ok) {
  return request({
    url: `/system/initiation/invoiceVetting?id=${id}&ok=${ok}`,
    method: 'get',
  })
}

// 应付汇总
export function updateReceived(id,received) {
  return request({
    url: `/system/application/received?id=${id}&received=${received}`,
    method: 'get',
  })
}

// 合同金额
export function updateContractAmount(id,bigDecimal) {
  return request({
    url: `/system/initiation/contractAmount?id=${id}&bigDecimal=${bigDecimal}`,
    method: 'get',
  })
}





